﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Ivs.Core.Data
{
    public class CommonData
    {
        /// <summary>
        /// 0: Successful
        /// 1: Access denied, login to database fail(invalid username, invalid password)
        /// 2: Invalid host, cannot find server(host) that set in app config file
        /// 3: Invalid database, cannot find database that set in DbConfig file
        /// 4: Lost connection, cannot connect to database because lost connection
        /// 5: Duplicate key: insert Primary Key or Unique Key that already exist in database
        /// 6: Forgeign key not exist: insert a foreign key that not exist in primary key
        /// 7: Foreign Key Violation: Foreign Key Violation (delete primary key that is foreign key in other table)
        /// 8: Data not found: Delete or Update data that not exist in database
        /// 9: Exception occured: other exception
        /// </summary>
        public struct DbReturnCode
        {
            public const int Succeed = 0;
            public const int AccessDenied = 1;
            public const int InvalidHost = 2;
            public const int InvalidDatabase = 3;
            public const int LostConnection = 4;
            public const int DuplicateKey = 5;
            public const int ForgeignKeyNotExist = 6;
            public const int ForeignKeyViolation = 7;
            public const int DataNotFound = 8;
            public const int ExceptionOccured = 9;
            public const int NoneAction = 10;
        }
    }
}
